import request from '../utils/request'

export const authApi = {
  /** 获取用户账号信息 */
  getUserAccount(payload: GetUserAccountPayload): Promise<GetUserAccountCallback> {
    return request.post('/wechat/mini-program', payload)
  },
  getUserPhone(params: GetUserAccountPayload): Promise<GetUserAccountCallback2> {
    return request.post('/wechat/getUserPhone', params)
  },
  /** 绑定用户账号 */
  bindUser(payload: BindUserPayload): Promise<BindUserCallback> {
    return request.put('/wechat/mini-program', payload)
  },

  /** 获取当前登录用户信息 */
  getCurrentUser(): Promise<DomoUserLogged> {
    return request.get('/user')
  },
}
